package mvc.views.mediators
{
	import globals.Url;
	
	import mvc.Notifications;
	
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	public class AppViewMediator extends Mediator implements IMediator
	{
		public static const NAME:String = "AppViewMediator";
		public function AppViewMediator(mediatorName:String=null, viewComponent:Object=null)
		{
			super(mediatorName, viewComponent);
		}
		
		override public function listNotificationInterests():Array
		{
			// TODO Auto Generated method stub
			return [
				Notifications.PROXY_APP_LABELS_BAR_PARSED,
				Notifications.PROXY_APP_CONTROLS_BAR_PARSED,
				Notifications.MEDIATOR_APP_TO_SHOW
			];
		}
		
		override public function handleNotification(notification:INotification):void
		{
			// TODO Auto Generated method stub
			super.handleNotification(notification);
			
			switch(notification.getName())
			{
				case Notifications.PROXY_APP_LABELS_BAR_PARSED:
					break;
				case Notifications.PROXY_APP_CONTROLS_BAR_PARSED:
					break;
				case Notifications.MEDIATOR_APP_TO_SHOW:
					sendNotification(Notifications.MEDIATOR_GOTO_CLIENT_URL,Url.USER_LOGIN);
					break;
			}
		}		
	}
}